package com.aiyige.model.request;

import com.aiyige.base.api.ApiManager;

import java.util.List;

import okhttp3.ResponseBody;
import retrofit2.Call;

/**
 * Created by zhuyakun on 2017/10/18.
 */

public class CourseIndexRequest {
    public static final int TYPE_LEARN_VIDEO = 1;
    public static final int TYPE_MAJOR_COURSE = 2;
    public static final int TYPE_TRAING_CLASS = 3;
    public static final int TYPE_PERSONAL_TRAINER = 4;

    Integer menuId;
    Integer pageNum;
    Integer pageSize;
    List<Integer> categoryId;
    String city;


    public CourseIndexRequest() {
    }

    private CourseIndexRequest(Builder builder) {
        setMenuId(builder.menuId);
        setPageNum(builder.pageNum);
        setPageSize(builder.pageSize);
        setCity(builder.city);
        setCategoryId(builder.categoryId);
    }

    public List<Integer> getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(List<Integer> categoryId) {
        this.categoryId = categoryId;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public int getMenuId() {
        return menuId;
    }

    public void setMenuId(int menuId) {
        this.menuId = menuId;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public static final class Builder {
        private Integer menuId;
        private Integer pageNum;
        private Integer pageSize;
        private List<Integer> categoryId;
        private String city;


        public Builder() {
            menuId = -1;
            pageNum = 0;
            pageSize = 15;
            categoryId = null;
            city = null;
        }

        public Builder menuId(int menuId) {
            this.menuId = menuId;
            return this;
        }

        public Builder pageNum(Integer pageNum) {
            this.pageNum = pageNum;
            return this;
        }

        public Builder pageSize(Integer pageSize) {
            this.pageSize = pageSize;
            return this;
        }

        public Builder categoryId(List<Integer> categoryId) {
            this.categoryId = categoryId;
            return this;
        }

        public Builder city(String city) {
            this.city = city;
            return this;
        }

        public Call<ResponseBody> build() {
            return ApiManager.getService().courseIndex(new CourseIndexRequest(this));
        }
    }
}
